#include <bits/stdc++.h>
using namespace std;

struct Range {
	char a;
	int b;
} range[260];

bool cmp1(struct Range a, struct Range b) {
	return a.a <= b.a;
}

bool cmp2(struct Range a, struct Range b) {
	return a.b < b.b;
}

int main() {
	string s;
	int k;
	cin >> s >> k;
	int n = s.size();
	for (int i = 0; i < n; ++i) {
		range[i].a = s[i];
		range[i].b =  i;
	}
	sort(range, range + n, cmp1);
	sort(range, range + (n - k), cmp2);
	for (int i = 0; i < (n - k); ++i) {
		cout << range[i].a;
	}
	return 0;
}